﻿@model List<MvcWeb.ViewModels.User.UserModel>
@{
    ViewBag.Title = "List";
}
@if (false)
{
    <script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
}
<div style="padding: 5px 10px;">
    <a href="@Url.Action("edit", "user", new { deptId = ViewContext.RouteData.Values["id"] })" class="btn_green">新建用户</a>
</div>
<div style="padding: 0px 10px;">
    <table class="tb" width="98%" style="text-align: center;">
        <tr>
            <th style="width: 20px;"></th>
            <th valign="top">登录名</th>
            <th>真实姓名</th>
            <th>部门</th>
            <th>角色</th>
            <th>操作</th>
        </tr>
        @foreach (var m in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" /></td>
                <td>@m.UserName</td>
                <td>@m.RealName</td>
                <td>@m.DeptName</td>
                <td>
                    @string.Join(",", m.RoleList)
                </td>
                <td width="80">
                    <a href="@Url.Action("edit", "user", new { id = m.UserId })">编辑</a>
                    <a href="@Url.Action("resetpwd", "user", new { id = m.UserName })" onclick="return confirm('确认重置吗？')">重置密码</a> 
                </td>
            </tr>
        }
        <tr>
            <td>
                <input type="checkbox" /></td>
            <td colspan="5" style="text-align: left;">
                <input type="button" value="删除用户" class="btn_red" />
            </td>
        </tr>
    </table>
</div>